Agentic SWARM Protocol
This guide describes the ValkyrAI SWARM messaging protocol for coordination between:
- ValkyrAI server workflows
- ValorIDE agent instances
- Web-based SageChat sessions
- ServerConsole processes
Core concepts
- Agents are peers with capabilities, state, and a heartbeat
- Messaging uses WebSocket STOMP with channels for broadcast, direct, and workflow-specific events
- ACL controls are enforced on every channel
Channel patterns
Broadcast
/topic/messages/topic/statuses/topic/agents/topic/agent-commands/topic/workflow-monitoring
Private
/user/{principalId}/queue/private/queue/agents/{instanceId}/commands/user/{principalId}/queue/notifications/topic/workflow/{workflowId}
Command endpoints
/app/chat/app/agent/register/app/agent/ack/app/agent/announce
Security model
- Authenticated with JWT (
Authorizationheader or?token=) - Private channel ownership enforced by principalId
- Admin-only channels require
ROLE_ADMINorROLE_SYSTEM
Message envelope
{
"id": "uuid-v4",
"type": "command|response|broadcast|event|ack|nack",
"from": { ... },
"to": { ... },
"timestamp": "ISO-8601 UTC",
"ackId": null,
"payload": {
"action": "execute|status|query|result",
"data": {},
"metadata": {}
},
"security": { "signature": "...", "encrypted": false },
"ttl": 300000,
"priority": "low|normal|high|urgent"
}
Flows
1. Agent registration
ValorIDE -> /app/agent/registerServer -> /topic/agentsbroadcast list
2. Command execution (ack+nack)
/queue/agents/{instanceId}/commandsfor command/app/agent/ackfor ack/nack/app/chatfor result
3. Workflow coordination
Workflows trigger agents via ExecModule edges; SWARM telemetry rich context (workflowId, correlationId).
Actionable sections
- Implement new agent feature: publish on
/topic/agentsand watch/topic/statuses - Add endpoint
agent/heartbeatto refresh lastSeen state - Use workflow-state metadata for traceability in telemetry dashboards
Adoption in code
- ValkyrAI backend:
SwarmRegistryService,MothershipService - Frontend:
/src/components/Swarm/,useSwarmAgentshooks - ValorIDE: integration on agent project +
mcpchannel adapters